#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
#define debug(a) cout<<#a<<":"<<a<<endl;
#define fr freopen("in.txt","r",stdin);
#define for0(i,a,b) for (int i=a;(i<b);i++)
#define for1(i,a,b) for (int i=a;(i<=b);i++)
#define dec0(i,a,b) for (int i=a;(i>b);i--)
#define dec1(i,a,b) for (int i=a;(i>=b);i--)
#define Fill(x,a) memset(x,a,sizeof(x))
const int INF=0x3f3f3f3f;
const int N=1e6+7;
const int mod=1e9+7;
int maxn,minn;
int T,n,m,q;

int main(){
	int a,b,c,p;
	cin>>T;
	for1(t,1,T){
		cin>>n>>p;
		printf("Team #%d\n",t);
		printf("Games: %d \n",n);
		printf("Points: %d\nPossible records:\n",p);
		for(int i=n;i>=0;i--){
			for(int j=n;j>=0;j--){
				if(i+j<=n&&i*3+j==p){
					a=i,b=j,c=n-a-b;
					printf("%d-%d-%d\n",a,b,c);
				}
			}
		}
		if(t!=T)
		printf("\n");
		
	}


	return 0;
}


